class CityOptionModel {
  int? value;
  String? label;
  List<CityOptionModel>? children;

  CityOptionModel({
    this.value,
    this.label,
    this.children,
  });

  static List<CityOptionModel> formJsonList(dynamic jsonList) {
    var list = <CityOptionModel>[];
    jsonList.forEach((c){
      list.add(CityOptionModel.fromJson(c));
    });
    return list;
  }

  CityOptionModel.fromJson(Map<String, dynamic> json) {
    value = json['value'];
    label = json['label'];
    if (json['children'] != null) {
      children = <CityOptionModel>[];
      json['children'].forEach((v) {
        children!.add(CityOptionModel.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> datas = <String, dynamic>{};
    datas['value'] = value;
    datas['label'] = label;
    datas['children'] = children;
    return datas;
  }
}

class CityPickerCheckModel {

  /// 省市区
  String? province = '';
  String? city = '';
  String? area = '';

  /// 对应的编码
  int? provinceId;
  int? cityId;
  int? areaId;

  CityPickerCheckModel({
    this.province,
    this.city,
    this.area,
    this.provinceId,
    this.cityId,
    this.areaId,
  });

  CityPickerCheckModel.fromJson(Map<String, dynamic> json) {
    province = json['province'];
    city = json['city'];
    area = json['area'];
    provinceId = json['provinceId'];
    cityId = json['cityId'];
    areaId = json['areaId'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> datas = <String, dynamic>{};
    datas['province'] = province;
    datas['city'] = city;
    datas['area'] = area;
    datas['provinceId'] = provinceId;
    datas['cityId'] = cityId;
    datas['areaId'] = areaId;

    return datas;
  }

}